#include <stdio.h>
#define MAX_SIZE 101
#define MAX 0x7EEEEEEE
#define min(a,b)  a < b ? a : b
/*
18 1
9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9
8 8 8 8 8 8 8 8 8 8 8 8 8 8 1 1 8 8

145
*/
int slow[MAX_SIZE],fast[MAX_SIZE],dp[2][15];
int now = 0,next = 1;

void ChangeNowNext() {
    int tmp = now;
    now = next;
    next = tmp;
}

int main() {
    int i,j,k,L,N;

    scanf("%d %d",&L,&N);
    for(i = 0;i < L;i ++)
        scanf("%d",&slow[i]);
    for(i = 0;i < L;i ++)
        scanf("%d",&fast[i]);

    for(i = 0;i < 15;i ++) {
        dp[0][i] = dp[1][i] = MAX;
    }

    dp[now][0] = 0;
    for(j = 0;j < N;j ++) {
        for(i = 0;i < L;i ++) {
            for(k = 0;k < 15;k ++) {
                dp[next][k + 1] = dp[now][k] + slow[i];
                if(k > 4)
                    dp[next][k - 5] = min(dp[next][k - 5],dp[now][k] + fast[i]);
            }
            dp[next][10] = min(dp[now][14] + slow[i],dp[next][10]);
            ChangeNowNext();
            dp[next][0] = MAX;
        }
    }

    for(i = 1;i < 15;i ++) {
        if(dp[now][i] < dp[now][0])
            dp[now][0] = dp[now][i];
    }
    printf("%d\n",dp[now][0]);
    return 0;
}
